package com.rpay.admin.controller.relationship;

import com.rpay.admin.controller.base.BaseController;
import com.rpay.common.dto.user.UserDTO;
import com.rpay.common.vo.PcsResult;
import com.rpay.model.level.RpayLevel;
import com.rpay.service.level.impl.LevelServiceImpl;
import com.rpay.service.user.impl.UserServiceImpl;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**

 */
@RestController
@RequestMapping(value = "api/relationship")
public class RpayRelationshipController extends BaseController {
    @Autowired
    private LevelServiceImpl levelServiceImpl;
    @Autowired
    private UserServiceImpl userService;

    @GetMapping()
    public PcsResult getLevelList(@RequestParam(name = "userId", defaultValue = "0") Integer userId, @RequestParam(name = "keyword", defaultValue = "") String keyword, @RequestParam(name = "deep", defaultValue = "0") int deep) {
        UserDTO userDTO = new UserDTO();
        userDTO.setId(userId);
        userDTO.setName(keyword);
        List<Map> treeData = null;
        // 改为同步树 一次全查完
        Map resultMap = userService.findUserListByKeyword(keyword);

        return PcsResult.build(resultMap);
    }

}
